<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8"/>
  <title>用户列表</title>
  <link rel="stylesheet" href="/css/bootstrap.css" th:href="@{/css/bootstrap.css}"/>
</head>
<body class="container">
<br/>
<h1>用户列表</h1>
<br/><br/>
<div class="with:80%">
  <table class="table table-hover">
    <thead>
    <tr>
      <th>序号</th>
      <th>用户名</th>
      <th>密码</th>
      <th>电话</th>
      <th>性别</th>
      <th>邮箱</th>
      <th>编辑</th>
      <th>删除</th>
    </tr>
    </thead>
    <tbody>
    <tr  th:each="user : ${users}">
      <th scope="row" th:text="${user.id}">1</th>
      <td th:text="${user.username}"></td>
      <td th:text="${user.password}"></td>
      <td th:text="${user.phone}"></td>
      <td th:text="${user.sex}"></td>
      <td th:text="${user.mail}"></td>
      <td><a th:href="@{/user/toEdit(id=${user.id},username=${user.username})}">编辑</a></td>
      <td><a th:href="@{/user/delete(id=${user.id})}">删除</a></td>
    </tr>
    </tbody>
  </table>
</div>
<div class="form-group">
  <div class="col-sm-2 control-label" >
    <a href="userLogin.html" th:href="@{/user/toAdd}" class="btn btn-info">添加</a>
  </div>
</div>
</body>
</html>